﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using U8WebService.BLL;

namespace U8WebService.Controllers
{
    public partial class U8APIController : Controller
    {
        // GET: U8API
        public ActionResult Index()
        {
            return View();
        }
    }
    // U8 13.0接口 库房管理类 
    public partial class U8APIController : Controller
    {
        //其他入库
        [HttpPost]
        public JsonResult OtherIn()
        {
            var stream = Request.InputStream;
            var reader = new StreamReader(stream);
            var jsonStr = reader.ReadToEnd();

            var wm = new U8_WarehouseManagement();
            return Json(wm.otherIn(jsonStr));
        }

        // 产成品入库
        //[HttpPost]
        //public JsonResult ProductIn()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.ProductIn(jsonStr));
        //}

        // 材料出库
        //[HttpPost]
        //public JsonResult MaterialOut()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.MaterialOut(jsonStr));
        //}

        // 调拨单
        //[HttpPost]
        //public JsonResult TransVouch()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.TransVouch(jsonStr));
        //}

        // 调拨单
        //[HttpPost]
        //public JsonResult TransVouchAudit()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.TransVouchAudit(jsonStr));
        //}

        // 直接写库的调拨单
        //[HttpPost]
        //public JsonResult TransVouchDirect()
        //{
        //    //获取单据流水号cardNumber为单据类型编码
        //    //            select* from VoucherNumber where cardNumber = '01' 单据编号规则设置表
        //    //            select* from VoucherHistory 单据流水号历史表
        //    //            通过存储过程Sp_getId 获得单据表头, 表体的Id,
        //    //            select *FROM UFSystem.UA_Identity where cAcc_Id = '005' 单据编号生成控制表（记录主表、子表id流水号）

        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.TransVouchDirect(jsonStr));
        //}


        // 货位调整
        //public JsonResult AdjustPostion()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();

        //    return Json(wm.PositionAdjust_Raw(jsonStr));
        //}

        //采购入库
        //[HttpPost]
        //public JsonResult PuStoreIn()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.PuStoreIn(jsonStr));
        //}

        //采购入库 直接写库
        //[HttpPost]
        //public JsonResult PuStoreInDirect()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.PuStoreInDirect(jsonStr));
        //}

        //其他出库
        //[HttpPost]
        //public JsonResult OtherOut()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var wm = new U8_WarehouseManagement();
        //    return Json(wm.otherOut(jsonStr));
        //}





    }

    // U8 13.0接口 销售管理类 
    public partial class U8APIController : Controller
    {
        // 销售出库
        //[HttpPost]
        //public JsonResult SaleOut()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var sm = new U8_SaleManagement();
        //    return Json(sm.SaleOut(jsonStr));
        //}
        // 直接写库的销售出库
        //[HttpPost]
        //public JsonResult SaleOutDirect()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var sm = new U8_SaleManagement();
        //    return Json(sm.SaleOutDirect(jsonStr));
        //}

        // 销售发票
        //[HttpPost]
        //public JsonResult SaleBillVouch()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var sm = new U8_SaleManagement();
        //    return Json(sm.SaleBillVouch(jsonStr));
        //}

    }

    // U8 13.0接口 采购管理类 
    public partial class U8APIController : Controller
    {
        // 采购订单
        //[HttpPost]
        //public JsonResult PurchaseOrder()
        //{
        //    var stream = Request.InputStream;
        //    var reader = new StreamReader(stream);
        //    var jsonStr = reader.ReadToEnd();

        //    var po = new U8_PurchaseManagement();
        //    return Json(po.PurchaseOrder(jsonStr));
        //}
    }


}